<template>
	<view>
		<u-navbar :is-back="true" title="医院入驻" :background="{backgroundColor: '#00a8ff'}">
			<view class="navbar-right" slot="right">
				<text style="color: #FFFFFF;margin-right: 20rpx;" color="#ffffff">我的</text>
			</view>
		</u-navbar>
		<u-search placeholder="" v-model="search" placeholder="请输入医院名称" :show-action="false"
			class="u-padding-left-26 u-padding-right-26 u-margin-top-26 u-margin-bottom-26"></u-search>
		<!-- <view class="" v-for="(item,index) in hospitalList" :key="index" class="cont"> -->
		<view style="width: 46%;margin-right: 28rpx;display: inline-block;margin-bottom: 20rpx"
			v-for="(item,index) in hospitalList" :key="index">
			<view class=" u-padding-left-26 u-padding-right-14 u-m-b-26 card"
				@click="openinfo('/pages/TheHospitalIn/hospitaShow?id='+item.id)">
				<image :src="url+item.logo" style="width: 100%;height: 300rpx;border-radius: 5rpx;"></image>
				<h4>{{item.title}}</h4>
				<p class="text">
					<u-icon name="map" class="u-m-r-10"></u-icon>{{item.address}}
				</p>
				<p class="text">
					<u-icon name="phone" class="u-m-r-10"></u-icon>{{item.tel}}
				</p>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				
				url: 'http://www.seoutr.com',
				// 请输入医院名称 搜索框 v-modle 绑定
				search: '',
				hospitalList: []
			}
		},
		onLoad() {
			console.debug("获取医院列表");
			this.hospitallist();
		},
		methods: {
			openinfo(url) {
				uni.navigateTo({
					url: url,
				});
			},
			// 获取医院列表
			hospitallist() {
				this.$apiBasics.hospitallist({
					limit: '',
					page: '',
					city_id: '',
					area_id: ''
				}).then((res) => {
					console.log('request success', res)
					uni.showToast({
						title: '请求成功',
						icon: 'success',
						mask: true
					});
					console.log(res.data.data.items);
					this.hospitalList = res.data.data.items;
				}).catch((err) => {
					this.loading = false;
					console.log('request fail', err);
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.cont {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-flow: row wrap;
		width: 100%;

		.card {
			width: 50%;
		}
	}

	.text {
		font-size: 20rpx;
		color: #6c6d6b;
	}
</style>
